<script type="text/javascript">

    $('.treenew li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
    function getsuser(ob) {
        // alert(123)
        if($(ob).children('#adimg').attr('src') == "__PUBLIC__/home/images/add.png"){
            $(ob).children('#adimg').attr('src',"__PUBLIC__/home/images/minus.png")
        }else{
            $(ob).children('#adimg').attr('src',"__PUBLIC__/home/images/add.png")
        }

        var children = $(ob).parent('li.parent_li').find(' > ul > li');
        if (children.is(":visible")) {
            children.hide('fast');
            $(ob).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
        } else if( $(ob).attr("index") == 1 ){
            children.show('fast');
            return false;
        }else {
            children.show('fast');
            $(ob).attr('index','1');

            var asd=$(ob).find("em").text();
            // alert(asd);
            var url = "{:U('Member/getInivt')}"
            var ob = $(ob);
            $.post(url,{'username':asd},function(msg){
                if(msg.status==1){

                    ob.attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
                    var str = "<ul>"
                    for(var i=0;i<msg.user.length;i++){
                        str += " <li class='parent_li' ><span class='tree' onclick='getsuser(this);'  data-key='on'><img src='__PUBLIC__/home/images/add.png' id='adimg'/><img src='__PUBLIC__/home/images/head2.png' /><em class='account'>"+msg['user'][i]['loginName']+"</em> - 注册日期："+msg['user'][i]['add_time']+"等级:"+msg['user'][i]['baodan']+"直推人数:"+msg['user'][i]['zhitui_num']+"</span></li>";
                    }
                    str += "</ul>";
                    ob.after(str);
                }else{
                    layer.msg('无下线会员')
                }
            })

        }
        // $(ob).stopPropagation();
    }

</script>
<style>
    .icon1{width:20px !important;
        height:20px !important;
        background-image:url(/Public/home/images/add.png);
        background-repeat:no-repeat;
        background-position:center;
        float:left;
        line-height: 35px;
        margin-top:6px;
    }
    .icon2{width:20px !important;
        height:20px !important;
        background-image:url(/Public/home/images/reduce.png);
        background-repeat:no-repeat;
        background-position:center;
        float:left;
        line-height: 35px;
        margin-top:6px;
    }
    .tree{ cursor:pointer;}
    .td{ height:35px; line-height:35px; text-align:left; padding-left:100px}
    .treenew {
        min-height:20px;
        padding:19px;
        margin-bottom:20px;
        background-color:#fbfbfb;
        border:1px solid #ccc;
        -webkit-border-radius:4px;
        -moz-border-radius:4px;
        border-radius:4px;
        -webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);
        -moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);
        box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05)
    }
    .treenew li {
        list-style-type:none;
        margin:0;
        padding:10px 5px 0 5px;
        position:relative
    }
    .treenew li::before, .treenew li::after {
        content:'';
        left:-20px;
        position:absolute;
        right:auto
    }
    .treenew li::before {
        border-left:1px solid #999;
        bottom:50px;
        height:100%;
        top:0;
        width:1px
    }
    .treenew li::after {
        border-top:1px solid #999;
        height:20px;
        top:25px;
        width:25px
    }
    .treenew li span {
        -moz-border-radius:5px;
        -webkit-border-radius:5px;
        border:1px solid #999;
        border-radius:5px;
        display:inline-block;
        padding:3px 8px;
        text-decoration:none
    }
    .treenew li.parent_li>span {
        cursor:pointer
    }
    .treenew>ul>li::before, .treenew>ul>li::after {
        border:0
    }
    .treenew li:last-child::before {
        height:25px
    }
    .treenew li.parent_li>span:hover, .treenew li.parent_li>span:hover+ul li span {
        background:#eee;
        border:1px solid #94a0b4;
        color:#000
    }
    .treenew ul{
        display: block;
        list-style-type: disc;
    //-webkit-margin-before: 1em;
    //-webkit-margin-after: 1em;
        -webkit-margin-start: 0px;
        -webkit-margin-end: 0px;
        -webkit-padding-start: 40px;
    }
</style>
<!--系谱图-->
 <include file="application/home/view/public/header.html"/>
      <!-- /.aside -->
      <section id="content">
        <section class="vbox">
          <section class="scrollable padder">
             <header class="header bg-light bg-gradient b-b">
            <p>首页</p>
          </header>

          <section class="panel panel-default">
              <header class="panel-heading "> 直推图 </header>
              <div class="row text-sm wrapper">
                <div class="col-sm-5 m-b-xs">
                  <form action="{:U('Home/Member/xipu')}" method="post"  role="form">
                    <input type="text" name="account"  class="input-sm form-control input-s-sm inline" >
                    <input type="submit" class="btn btn-sm btn-default" value="搜索">
                  </form>
                </div>
              </div>
              <div class="table-responsive">
                <div class="result-wrap">
                    <div class="treenew well">
                        <ul>
                            <li class="parent_li">
                                <span class="tree" onclick="getsuser(this);" data-key="on">
                                <img src="__PUBLIC__/home/images/add.png" id="adimg"/><img src="__PUBLIC__/home/images/head2.png" /><em class="account">{$user.loginName}</em> - 注册日期：{$user.createTime|date="Y-m-d H:i:s",###}等级:{$baodan_level}    直推人数:{$user.zhitui_num}</span>
                            </li>
                        </ul>
                    </div>
                </div>
              </div>
              
            </section>
          </section>
        </section>
        <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a> </section>
      <aside class="bg-light lter b-l aside-md hide" id="notes">
        <div class="wrapper">Notification</div>
      </aside>
    </section>
  </section>
</section>
<script src="__PUBLIC__/home/js/app.v2.js"></script> <!-- Bootstrap --> <!-- App --> <script src="__PUBLIC__/home/js/charts/easypiechart/jquery.easy-pie-chart.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/sparkline/jquery.sparkline.min.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/jquery.flot.min.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/jquery.flot.tooltip.min.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/jquery.flot.resize.js" cache="false"></script> <script src="js/charts/flot/jquery.flot.grow.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/demo.js" cache="false"></script> <script src="__PUBLIC__/home/js/calendar/bootstrap_calendar.js" cache="false"></script> <script src="__PUBLIC__/home/js/calendar/demo.js" cache="false"></script> <script src="__PUBLIC__/home/js/sortable/jquery.sortable.js" cache="false"></script>
<script src="__PUBLIC__/js/layer/layer.js" type="text/javascript"></script>
</body>
</html>
